<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/page-tags" prefix="p" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>角色列表</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<jsp:include page="../common.jsp"/>
  </head>
  <body>
  	<fieldset> 
		<div class="box_tool_min padding_top2 padding_bottom2 padding_right5">
			<div class="center">
				<div class="left">
					<div class="right">
						<div class="padding_top5 padding_left10">
							<a href="sys/role/add"><span class="icon_add">新增</span></a>
							<div class="clear"></div>
						</div>
					</div>		
				</div>	
			</div>
			<div class="clear"></div>
		</div>     	
	</fieldset>
    <div id="scrollContent" class="padding_top5"  style="overflow-x:hidden;">
		<table class="tableStyle" mode="list" fixedCellHeight="true">
    	<tr>
    		<th>序号</th>
    		<th>角色名称</th>
    		<th>角色描述</th>
    		<th>启用状态</th>
    		<th>创建人</th>
    		<th>创建时间</th>
    		<th>操作</th>
    	</tr>
    	<c:forEach items="${pager.content }" var="o" varStatus="i">
   		<tr>
    		<td>${i.count}</td>
    		<td>${o.roleName}</td>
    		<td>${o.roleDesc}</td>
    		<td>${status[o.enabled]}</td>
    		<td>${o.creator}</td>
    		<td>${o.createTime}</td>
    		<td>
    			<a href="sys/role/update/${o.roleId}"><span class="img_edit hand" title="修改"></span></a>
    			<a href="javascript:doDel('${o.roleId}')"><span class="img_delete hand" title="删除"></span></a>
    		</td>
    	</tr>
    	</c:forEach>
    </table>
    </div>
    <div style="height:35px;">
		<div class="float_left padding5"></div>
		<div class="float_right padding5">
			<p:page pager="${pager }"></p:page>
		</div>
		<div class="clear"></div>
	</div>
	<script type="text/javascript">
		function doDel(id){
			top.Dialog.confirm("删除后将无法恢复, 请谨慎操作!",function(){
				location.href="${pageContext.request.contextPath}/sys/role/delete/"+id;
			});
		}
	</script>
  </body>
</html>
